﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using KPIS.GERP.GHRMS.MODEL;
using KPIS.GERP.GHRMS.DAL;

namespace KPIS.GERP.GHRMS.APP.App_UI.Forms
{
    public partial class TR_TrainerDistrict : System.Web.UI.Page
    {
       TR_TrainerDistrictInfo distinfo = new TR_TrainerDistrictInfo();
       TR_TrainerDistrictDAL distdal = new TR_TrainerDistrictDAL();


        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //Session["tmp_emp_seq"] = Request.QueryString["id"];
                //Session["UserID"] = "555";
                grdDistrict.DataSource = distdal.GetFill();
                grdDistrict.DataBind();
            }

        }


        protected void grdDistrict_ItemCommand(object o, GridCommandEventArgs e)
        {
            if (e.CommandName != "RowClick")
            {
                grdDistrict.DataSource = distdal.GetFill();
                grdDistrict.DataBind();                

            }
                
            //if (e.CommandName == "Sort" || e.CommandName == "Filter")
            //{
            //    grdDistrict.DataSource = distdal.GetFill();
            //    grdDistrict.DataBind();
            //}
            //string a = e.CommandName;

        }


        protected void btnSelect_OnClick(object sender, EventArgs e)
        {
            for (int i = 0; i < grdDistrict.Items.Count; i++)
            {
                GridDataItem item = grdDistrict.Items[i];
                CheckBox chk = (CheckBox)item["ClientSelectColumn"].Controls[0];

                if (chk.Checked)
                {
                    item["ClientSelectColumn"].Enabled = false;
                    string strStatus = item["district_seq"].Text;
                    

                }
            }

                //grdTRRequestList.DataSource = tr_trainingdal.GetFill();
                //grdTRRequestList.DataBind();
        }
        protected void grdDistrict_ItemDataBound(object sender, GridItemEventArgs e)
        {
            //if (e.Item is GridDataItem)
            //{
            //    GridDataItem item = (GridDataItem)e.Item;
            //    string strStatusSeq = item["district_seq"].Text;

            //    if (strStatusSeq != "2")
            //    {
            //        item["ClientSelectColumn"].Enabled = false;
            //    }
            //    else
            //    {
            //        item["ClientSelectColumn"].Enabled = true;
            //    }
            //}
        }
    }            
}

